 package sza.oracle.apps.ap.oie.entry.lines.webui;
 
 import com.sun.java.util.collections.HashMap;
 import java.io.PrintStream;
 import java.io.Serializable;
 import java.sql.CallableStatement;
 import java.sql.SQLException;
 import oracle.apps.ap.oie.entry.webui.EntryFlowPageCO;
 import oracle.apps.ap.oie.framework.webui.OIEPageCO;
 import oracle.apps.ap.oie.webui.NavigationUtility;
 import oracle.apps.fnd.common.MessageToken;
 import oracle.apps.fnd.common.VersionInfo;
 import oracle.apps.fnd.framework.OAApplicationModule;
 import oracle.apps.fnd.framework.OAException;
 import oracle.apps.fnd.framework.OAViewObject;
 import oracle.apps.fnd.framework.server.OADBTransaction;
 import oracle.apps.fnd.framework.webui.OAControllerImpl;
 import oracle.apps.fnd.framework.webui.OAPageContext;
 import oracle.apps.fnd.framework.webui.OAPartialPageRenderUtils;
 import oracle.apps.fnd.framework.webui.beans.OAWebBean;
 import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
 import oracle.apps.fnd.framework.webui.beans.nav.OATrainBean;
 import oracle.cabo.ui.collection.UINodeList;
 import oracle.jbo.Row;
 import sza.oracle.apps.ap.oie.server.ExpenseTypeHierarchyVOImpl;
 import sza.oracle.apps.ap.oie.utility.SzaOIEUtil;
 
 public class ExpenseTypeTreeCO extends OAControllerImpl
 {
   public static final String RCS_ID = "$Header$";
   public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header$", "%packagename%");
 
   public void processRequest(OAPageContext pageContext, OAWebBean webBean)
   {
     String LogMessage = "";
     String LogFunction = "";
     LogFunction = "SZA ExpenseTypeTreeCO.processRequest";
 
     LogMessage = "SZA ExpenseTypeTreeCO.processRequest - Start";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     SzaOIEUtil.printContextParameter(pageContext, webBean);
 
     SzaOIEUtil.printContextTransaction(pageContext, webBean);
 
     SzaOIEUtil.printContextSession(pageContext, webBean);
 
     String ReportLineId = pageContext.getParameter("SDP_RLID");
     System.out.println("ReportLineId:" + ReportLineId);
 
     pageContext.putTransactionValue("SzaReportLineId", ReportLineId);
 
     super.processRequest(pageContext, webBean);
 
     String str = pageContext.getParameter("SDP_CALLING_MODULE");
     if (!"CONFIRMATION".equals(str))
     {
       pageContext.getPageLayoutBean().setLocation(createWebBean(pageContext, "appsentryEntryTrainRN", null, true));
 
       EntryFlowPageCO.renderTrain(pageContext);
     }
 
     String CurrentPage = NavigationUtility.getCurrentPage(pageContext);
     LogMessage = "SZA SzaButtonsCO.processFormRequest - CurrentPage:" + CurrentPage;
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     if (CurrentPage.equals("ExpenseTypeTreePG"))
     {
       CurrentPage = "CashAndOtherLinesPG";
     }
     LogMessage = "SZA SzaButtonsCO.processFormRequest - CurrentPage:" + CurrentPage;
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     OATrainBean oATrainBean = (OATrainBean)pageContext.getPageLayoutBean().getLocation();
 
     UINodeList localUINodeList = oATrainBean.getIndexedNodeList();
 
     int i = 0;
     int j = 0;
     while ((j == 0) && (i < localUINodeList.size(pageContext.getRenderingContext())))
     {
       OAWebBean localOAWebBean = (OAWebBean)localUINodeList.getUINode(pageContext.getRenderingContext(), i);
 
       if (localOAWebBean.getID().equals(CurrentPage))
         j = 1;
       else
         i++;
     }
     oATrainBean.setMaxVisited(i);
     oATrainBean.setSelectedIndex(i);
     System.out.println("localUINodeList.getUINode:" + i);
 
     NavigationUtility.checkStateLossError(pageContext);
 
     OIEPageCO.processContactUs(pageContext);
     OIEPageCO.renderCCMenu(pageContext, webBean);
 
     OIEPageCO.renderProjectsAndTasks(pageContext, webBean);
 
     String LineClicked = pageContext.getParameter("LineClicked");
 
     MessageToken[] arrayOfMessageToken = { new MessageToken("LINE", LineClicked) };
 
     String localObject3 = pageContext.getMessage("SQLAP", "SZA_OIE_EXPENSE_TYPE_TITLE", arrayOfMessageToken);
 
     OAPageLayoutBean oAPageLayoutBean = (OAPageLayoutBean)webBean;
     oAPageLayoutBean.setTitle(localObject3);
 
     if (!pageContext.isFormSubmission())
     {
       OAWebBean treeRN = webBean.findIndexedChildRecursive("TreeRN");
       if (treeRN != null)
       {
         treeRN.setRendered(true);
 
         initPage(pageContext, webBean);
       }
 
     }
 
     LogMessage = "SZA ExpenseTypeTreeCO.processRequest - End";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
   }
 
   public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
   {
     String LogMessage = "";
     String LogFunction = "";
     LogFunction = "SZA ExpenseTypeTreeCO.processFormRequest";
 
     LogMessage = "SZA ExpenseTypeTreeCO.processFormRequest - Start";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     super.processFormRequest(pageContext, webBean);
 
     processRequestPageButtons(pageContext, webBean);
 
     OAPartialPageRenderUtils.addPartialTargets(pageContext, "TreeRN");
 
     processTreeNodePost(pageContext, webBean);
 
     LogMessage = "SZA ExpenseTypeTreeCO.processFormRequest - End";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
   }
 
   private void processTreeNodePost(OAPageContext pageContext, OAWebBean webBean)
   {
     String LogMessage = "";
     String LogFunction = "";
     LogFunction = "SZA ExpenseTypeTreeCO.processTreeNodePost";
 
     LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - Start";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     SzaOIEUtil.printContextParameter(pageContext, webBean);
 
     SzaOIEUtil.printContextTransaction(pageContext, webBean);
 
     String IsExpenseRecognitionReport = (String)pageContext.getTransactionValue("IsExpenseRecognitionReport");
 
     OAApplicationModule am = pageContext.getApplicationModule(webBean);
 
     if ("LinkExpenseTypeTree".equals(pageContext.getParameter("event")))
     {
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - LinkExpenseTypeTree - Start";
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String SelectedTreeNodeValue = null;
       SelectedTreeNodeValue = pageContext.getParameter("SelectedTreeNodeValue");
 
       LogMessage = "SelectedTreeNodeValue:" + SelectedTreeNodeValue;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute1 = null;
       ExpTypeAttribute1 = pageContext.getParameter("ExpTypeAttribute1");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute1 - " + ExpTypeAttribute1;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute2 = null;
       ExpTypeAttribute2 = pageContext.getParameter("ExpTypeAttribute2");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute2 - " + ExpTypeAttribute2;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute3 = null;
       ExpTypeAttribute3 = pageContext.getParameter("ExpTypeAttribute3");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute3 - " + ExpTypeAttribute3;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute4 = null;
       ExpTypeAttribute4 = pageContext.getParameter("ExpTypeAttribute4");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute4 - " + ExpTypeAttribute4;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute5 = null;
       ExpTypeAttribute5 = pageContext.getParameter("ExpTypeAttribute5");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute5 - " + ExpTypeAttribute5;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute6 = null;
       ExpTypeAttribute6 = pageContext.getParameter("ExpTypeAttribute6");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute6 - " + ExpTypeAttribute6;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute7 = null;
       ExpTypeAttribute7 = pageContext.getParameter("ExpTypeAttribute7");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute7 - " + ExpTypeAttribute7;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute8 = null;
       ExpTypeAttribute8 = pageContext.getParameter("ExpTypeAttribute8");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute8 - " + ExpTypeAttribute8;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute9 = null;
       ExpTypeAttribute9 = pageContext.getParameter("ExpTypeAttribute9");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute9 - " + ExpTypeAttribute9;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute10 = null;
       ExpTypeAttribute10 = pageContext.getParameter("ExpTypeAttribute10");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute10 - " + ExpTypeAttribute10;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute11 = null;
       ExpTypeAttribute11 = pageContext.getParameter("ExpTypeAttribute11");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute11 - " + ExpTypeAttribute11;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute12 = null;
       ExpTypeAttribute12 = pageContext.getParameter("ExpTypeAttribute12");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute12 - " + ExpTypeAttribute12;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute13 = null;
       ExpTypeAttribute13 = pageContext.getParameter("ExpTypeAttribute13");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute13 - " + ExpTypeAttribute13;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute14 = null;
       ExpTypeAttribute14 = pageContext.getParameter("ExpTypeAttribute14");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute14 - " + ExpTypeAttribute14;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeAttribute15 = null;
       ExpTypeAttribute15 = pageContext.getParameter("ExpTypeAttribute15");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute15 - " + ExpTypeAttribute15;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment1 = null;
       ExpTypeSegment1 = pageContext.getParameter("ExpTypeSegment1");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment1 - " + ExpTypeSegment1;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment2 = null;
       ExpTypeSegment2 = pageContext.getParameter("ExpTypeSegment2");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment2 - " + ExpTypeSegment2;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment3 = null;
       ExpTypeSegment3 = pageContext.getParameter("ExpTypeSegment3");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment3 - " + ExpTypeSegment3;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment4 = null;
       ExpTypeSegment4 = pageContext.getParameter("ExpTypeSegment4");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment4 - " + ExpTypeSegment4;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment5 = null;
       ExpTypeSegment5 = pageContext.getParameter("ExpTypeSegment5");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment5 - " + ExpTypeSegment5;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment6 = null;
       ExpTypeSegment6 = pageContext.getParameter("ExpTypeSegment6");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment6 - " + ExpTypeSegment6;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment7 = null;
       ExpTypeSegment7 = pageContext.getParameter("ExpTypeSegment7");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment7 - " + ExpTypeSegment7;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment8 = null;
       ExpTypeSegment8 = pageContext.getParameter("ExpTypeSegment8");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment8 - " + ExpTypeSegment8;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment9 = null;
       ExpTypeSegment9 = pageContext.getParameter("ExpTypeSegment9");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment9 - " + ExpTypeSegment9;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment10 = null;
       ExpTypeSegment10 = pageContext.getParameter("ExpTypeSegment10");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment10 - " + ExpTypeSegment10;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment11 = null;
       ExpTypeSegment11 = pageContext.getParameter("ExpTypeSegment11");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment11 - " + ExpTypeSegment11;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment12 = null;
       ExpTypeSegment12 = pageContext.getParameter("ExpTypeSegment12");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment12 - " + ExpTypeSegment12;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment13 = null;
       ExpTypeSegment13 = pageContext.getParameter("ExpTypeSegment13");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment13 - " + ExpTypeSegment13;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment14 = null;
       ExpTypeSegment14 = pageContext.getParameter("ExpTypeSegment14");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment14 - " + ExpTypeSegment14;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String ExpTypeSegment15 = null;
       ExpTypeSegment15 = pageContext.getParameter("ExpTypeSegment15");
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeSegment15 - " + ExpTypeSegment15;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       String TempSelectedTreeNodeValue = "";
       TempSelectedTreeNodeValue = TempSelectedTreeNodeValue + ExpTypeSegment1 + ".";
       TempSelectedTreeNodeValue = TempSelectedTreeNodeValue + ExpTypeSegment2 + ".";
       TempSelectedTreeNodeValue = TempSelectedTreeNodeValue + ExpTypeSegment3 + ".";
       TempSelectedTreeNodeValue = TempSelectedTreeNodeValue + "XXXXXXX.";
       TempSelectedTreeNodeValue = TempSelectedTreeNodeValue + ExpTypeSegment5;
       if ((ExpTypeSegment6 != null) && (ExpTypeSegment6 != ""))
       {
         TempSelectedTreeNodeValue = TempSelectedTreeNodeValue + "." + ExpTypeSegment6;
       }
 
       LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - TempSelectedTreeNodeValue - " + TempSelectedTreeNodeValue;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       if ((ExpTypeAttribute15 != null) && (!"".equalsIgnoreCase(ExpTypeAttribute15)))
       {
         String FlexConcatenated = "";
         String DefaultCostCenter = (String)pageContext.getTransactionValue("DefaultCostCenter");
 
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - DefaultCostCenter:" + DefaultCostCenter.toString();
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String $$FWK_MultiOrgCurrentOrgId = (String)pageContext.getTransactionValue("$$FWK_MultiOrgCurrentOrgId");
 
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - $$FWK_MultiOrgCurrentOrgId:" + $$FWK_MultiOrgCurrentOrgId.toString();
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String TemplateId = (String)pageContext.getTransactionValue("TemplateId");
 
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - TemplateId:" + TemplateId.toString();
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String EmployeeId = (String)pageContext.getTransactionValue("EmployeeId");
 
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - EmployeeId :" + EmployeeId.toString();
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String CompanyCode = SzaOIEUtil.getEmployeeCompanyCode(pageContext, webBean, EmployeeId);
 
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - CompanyCode:" + CompanyCode.toString();
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String BudgetCostCenterCode = "";
 
         OAViewObject HeaderVo = (OAViewObject)am.findViewObject("ExpenseReportHeadersVO");
 
         if (HeaderVo != null)
         {
           LogMessage = "SZA ExpenseReportHeadersVO - Start ";
 
           SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
           FlexConcatenated = (String)HeaderVo.getCurrentRow().getAttribute("FlexConcatenated");
 
           BudgetCostCenterCode = (String)HeaderVo.getCurrentRow().getAttribute("Attribute12");
 
           LogMessage = "SZA ExpenseReportHeadersVO - End ";
 
           SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
         }
 
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - BudgetCostCenterCode:" + BudgetCostCenterCode;
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String ExpItem01 = ExpTypeSegment5;
         if (ExpItem01 == null)
         {
           ExpItem01 = "0";
         }
         String ExpItem02 = ExpTypeSegment6;
         if (ExpItem02 == null)
         {
           ExpItem02 = "0";
         }
 
         if ((BudgetCostCenterCode == null) || (BudgetCostCenterCode == ""))
         {
           BudgetCostCenterCode = FlexConcatenated;
         }
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - BudgetCostCenterCode:" + BudgetCostCenterCode;
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String BudgetGlAccount = SzaOIEUtil.getBudgetGlAccount(pageContext, webBean, $$FWK_MultiOrgCurrentOrgId, TemplateId, CompanyCode, BudgetCostCenterCode, ExpItem01, ExpItem02);
 
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - BudgetGlAccount:" + BudgetGlAccount.toString();
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String GlAccount = SzaOIEUtil.getGlAccount(pageContext, webBean, $$FWK_MultiOrgCurrentOrgId, TemplateId, CompanyCode, FlexConcatenated, ExpItem01, ExpItem02);
 
         LogMessage = "SZA ExpenseTypeTreeCO processRequest - GlAccount:" + GlAccount.toString();
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - if (ExpTypeAttribute15 != null && !\"\".equalsIgnoreCase(ExpTypeAttribute15))";
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         LogMessage = "Expense Type AM Name is =>" + am.getFullName();
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
         try
         {
           Serializable[] aserializable3 = { Boolean.FALSE };
 
           Class[] aclass2 = { Boolean.class };
 
           am.invokeMethod("updateLines", aserializable3, aclass2);
         }
         catch (OAException oaexception1)
         {
         }
 
         String ReportLineId = pageContext.getTransactionValue("SzaReportLineId").toString();
 
         LogMessage = "ReportLineId:" + ReportLineId;
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         String ReportHeaderId = (String)pageContext.getTransactionValue("ReportHeaderId");
 
         LogMessage = "ReportHeaderId:" + ReportHeaderId;
 
         SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
         Serializable[] aserializable7 = { Boolean.FALSE, ReportLineId };
 
         Class[] aclass4 = { Boolean.class, String.class };
 
         Boolean boolean1 = (Boolean)am.invokeMethod("isReportLineValid", aserializable7, aclass4);
 
         HashMap hashmap = new HashMap();
         hashmap.put("SDP_RHID", NavigationUtility.encrypt(pageContext, ReportHeaderId));
 
         hashmap.put("SDP_RLID", NavigationUtility.encrypt(pageContext, ReportLineId));
 
         hashmap.put("SDP_EXP_CLASS", "SDP_EXP_CLASS_CASH");
 
         hashmap.put("SDP_UPDATE_MODE", "UPDATE");
 
         hashmap.put("SDP_CALLING_MODULE", "SZA_CASH_ET");
 
         if (Boolean.FALSE.equals(boolean1)) {
           hashmap.put("SDP_SHOW_ERRORS", "SDP_SHOW_ERRORS");
         }
 
         OAViewObject LineVo = (OAViewObject)am.findViewObject("CashAndOtherLinesVO");
 
         if (LineVo != null)
         {
           LineVo.first();
 
           LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - Line Loop - Start";
 
           SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
           while (LineVo.hasNext())
           {
             Row row = LineVo.getCurrentRow();
 
             String strRowReportLineId = row.getAttribute("ReportLineId").toString();
 
             LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - strRowReportLineId:" + strRowReportLineId;
 
             SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
             if (ReportLineId.equals(strRowReportLineId))
             {
               LogMessage = "SZA ExpenseTypeTreeCO processRequest - GlAccount:" + GlAccount.toString();
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO processRequest - SelectedTreeNodeValue:" + SelectedTreeNodeValue.toString();
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute1 - " + ExpTypeAttribute1;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute2 - " + ExpTypeAttribute2;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute10 - " + ExpTypeAttribute10;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute11 - " + ExpTypeAttribute11;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute12 - " + ExpTypeAttribute12;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute13 - " + ExpTypeAttribute13;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute14 - " + ExpTypeAttribute14;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - ExpTypeAttribute15 - " + ExpTypeAttribute15;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               if ("Y".equalsIgnoreCase(IsExpenseRecognitionReport))
               {
                 GlAccount = ExpTypeAttribute15;
               }
               LogMessage = "SZA ExpenseTypeTreeCO - initPage - Expense Report Template - IsExpenseRecognitionReport:" + IsExpenseRecognitionReport;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               row.setAttribute("WebParameterId", ExpTypeAttribute1);
 
               row.setAttribute("ItemDescription", ExpTypeAttribute2);
 
               row.setAttribute("Attribute10", TempSelectedTreeNodeValue);
 
               row.setAttribute("Attribute11", SelectedTreeNodeValue);
 
               row.setAttribute("Attribute12", ExpTypeAttribute12);
 
               row.setAttribute("Attribute13", ExpTypeAttribute13);
 
               row.setAttribute("Attribute14", ExpTypeAttribute14);
 
               row.setAttribute("Attribute15", GlAccount);
 
               LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - Update Line VO - ReportLineId = " + ReportLineId;
 
               SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
               break;
             }
 
             LineVo.next();
           }
           LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - Line Loop - End";
 
           SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
         }
 
         NavigationUtility.forwardToPage(pageContext, "CashAndOtherLinesPG", hashmap);
       }
 
     }
 
     LogMessage = "SZA ExpenseTypeTreeCO.processTreeNodePost - End";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
   }
 
   private void initPage(OAPageContext pageContext, OAWebBean webBean)
   {
     String LogMessage = "";
     String LogFunction = "";
     LogFunction = "ExpenseTypeTreeCO.initPage";
 
     LogMessage = "SZA ExpenseTypeTreeCO.initPage - Start";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     String IsExpenseRecognitionReport = (String)pageContext.getTransactionValue("IsExpenseRecognitionReport");
 
     OAApplicationModule am = pageContext.getApplicationModule(webBean);
     OADBTransaction oadbtransaction = am.getOADBTransaction();
 
     String $$FWK_MultiOrgCurrentOrgId = (String)pageContext.getTransactionValue("$$FWK_MultiOrgCurrentOrgId");
 
     LogMessage = "SZA ExpenseTypeTreeCO processRequest - $$FWK_MultiOrgCurrentOrgId:" + $$FWK_MultiOrgCurrentOrgId.toString();
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     String TemplateId = (String)pageContext.getTransactionValue("TemplateId");
 
     LogMessage = "SZA ExpenseTypeTreeCO processRequest - TemplateId:" + TemplateId.toString();
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     String EmployeeId = (String)pageContext.getTransactionValue("EmployeeId");
 
     LogMessage = "SZA ExpenseTypeTreeCO processRequest - EmployeeId :" + EmployeeId.toString();
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     String CompanyCode = SzaOIEUtil.getEmployeeCompanyCode(pageContext, webBean, EmployeeId);
 
     LogMessage = "SZA ExpenseTypeTreeCO processRequest - CompanyCode:" + CompanyCode.toString();
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     String DefaultCostCenter = (String)pageContext.getTransactionValue("DefaultCostCenter");
 
     LogMessage = "SZA ExpenseTypeTreeCO processRequest - DefaultCostCenter:" + DefaultCostCenter.toString();
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     String FlexConcatenated = "";
     String BudgetCostCenterCode = "";
 
     OAViewObject HeaderVo = (OAViewObject)am.findViewObject("ExpenseReportHeadersVO");
 
     if (HeaderVo != null)
     {
       LogMessage = "SZA ExpenseReportHeadersVO - Start ";
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       FlexConcatenated = (String)HeaderVo.getCurrentRow().getAttribute("FlexConcatenated");
 
       LogMessage = "SZA ExpenseReportHeadersVO - FlexConcatenated =  " + FlexConcatenated;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       BudgetCostCenterCode = (String)HeaderVo.getCurrentRow().getAttribute("Attribute12");
 
       LogMessage = "SZA ExpenseReportHeadersVO - End ";
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
     }
 
     LogMessage = "SZA ExpenseTypeTreeCO processRequest - BudgetCostCenterCode:" + BudgetCostCenterCode;
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     if ((BudgetCostCenterCode != null) && (BudgetCostCenterCode != ""))
     {
       FlexConcatenated = BudgetCostCenterCode;
     }
 
     if ("Y".equalsIgnoreCase(IsExpenseRecognitionReport))
     {
       FlexConcatenated = "";
     }
     LogMessage = "SZA ExpenseTypeTreeCO - initPage - Expense Report Template Additional - End";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     LogMessage = "SZA ExpenseTypeTreeCO processRequest - BudgetCostCenterCode:" + BudgetCostCenterCode;
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     super.processRequest(pageContext, webBean);
 
     LogMessage = "Expense Type AM Name is =>" + am.getFullName();
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     ExpenseTypeHierarchyVOImpl vo = (ExpenseTypeHierarchyVOImpl)am.findViewObject("ExpenseTypeHierarchyVO1");
 
     if (vo == null)
     {
       vo = (ExpenseTypeHierarchyVOImpl)am.createViewObject("ExpenseTypeHierarchyVO1", "sza.oracle.apps.ap.oie.server.ExpenseTypeHierarchyVO");
     }
 
     if (vo != null)
     {
       vo.clearCache();
       vo.refreshWhereClauseParams();
 
       String strSql = "{call ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT1(:1); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT2(:2); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT3(:3); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT4(:4); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT5(:5); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT6(:6);  ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT7(:7); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT8(:8); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT9(:9); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT10(:10); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT11(:11); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT12(:12);  ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT13(:13); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT14(:14); ";
       strSql = strSql + " sza_oie_exp_type_tree_pkg.SET_SEGMENT15(:15)  ";
 
       strSql = strSql + " } ";
       CallableStatement callablestatement = oadbtransaction.createCallableStatement(strSql, 1);
 
       LogMessage = "SZA ExpenseTypeTreeCO processRequest - $$FWK_MultiOrgCurrentOrgId:" + $$FWK_MultiOrgCurrentOrgId.toString();
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       LogMessage = "SZA ExpenseTypeTreeCO processRequest - TemplateId:" + TemplateId.toString();
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       LogMessage = "SZA ExpenseTypeTreeCO processRequest - CompanyCode:" + CompanyCode.toString();
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       LogMessage = "SZA ExpenseTypeTreeCO processRequest - DefaultCostCenter:" + DefaultCostCenter.toString();
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       LogMessage = "SZA ExpenseTypeTreeCO processRequest - FlexConcatenated:" + FlexConcatenated;
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
       try
       {
         callablestatement.setString(1, $$FWK_MultiOrgCurrentOrgId);
 
         callablestatement.setString(2, TemplateId);
 
         callablestatement.setString(3, CompanyCode);
 
         callablestatement.setString(4, FlexConcatenated);
 
         callablestatement.setString(5, "");
 
         callablestatement.setString(6, "");
 
         callablestatement.setString(7, "");
 
         callablestatement.setString(8, "");
 
         callablestatement.setString(9, "");
 
         callablestatement.setString(10, "");
 
         callablestatement.setString(11, "");
 
         callablestatement.setString(12, "");
 
         callablestatement.setString(13, "");
 
         callablestatement.setString(14, "");
 
         callablestatement.setString(15, "");
 
         callablestatement.execute();
       }
       catch (SQLException sqlexception)
       {
         oadbtransaction.rollback();
         throw OAException.wrapperException(sqlexception);
       }
       finally
       {
         try
         {
           callablestatement.close();
         }
         catch (Exception localException1)
         {
           throw OAException.wrapperException(localException1);
         }
       }
       oadbtransaction.commit();
 
       String WhereClause = " 1 = 1 ";
       WhereClause = WhereClause + " AND TRIM(tree_node_code_p) = '0' ";
 
       LogMessage = "SZA Tree VO WhereClause:" + vo.getQuery();
 
       SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
       vo.setWhereClause(WhereClause);
       vo.setWhereClauseParams(null);
       vo.executeQuery();
     }
     LogMessage = "SZA ExpenseTypeTreeCO.initPage - End";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
   }
 
   private void processRequestPageButtons(OAPageContext pageContext, OAWebBean webBean)
   {
     String LogMessage = "";
     String LogFunction = "";
     LogFunction = "ExpenseTypeTreeCO.processRequestPageButtons";
 
     LogMessage = "SZA ExpenseTypeTreeCO.processRequestPageButtons - Start";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
 
     SzaOIEUtil.printContextParameter(pageContext, webBean);
 
     SzaOIEUtil.printContextTransaction(pageContext, webBean);
 
     if ("ReturnButton".equals(pageContext.getParameter("event")))
     {
       System.out.println("2RBExpenseTypeTree");
 
       String SzaReportLineId = pageContext.getTransactionValue("SzaReportLineId").toString();
 
       String ReportHeaderId = (String)pageContext.getTransactionValue("ReportHeaderId");
 
       Serializable[] aserializable7 = { Boolean.FALSE, SzaReportLineId };
 
       Class[] aclass4 = { Boolean.class, String.class };
 
       HashMap hashmap = new HashMap();
       hashmap.put("SDP_RHID", NavigationUtility.encrypt(pageContext, ReportHeaderId));
 
       hashmap.put("SDP_RLID", NavigationUtility.encrypt(pageContext, SzaReportLineId));
 
       hashmap.put("SDP_EXP_CLASS", "SDP_EXP_CLASS_CASH");
 
       hashmap.put("SDP_UPDATE_MODE", "UPDATE");
 
       hashmap.put("SDP_CALLING_MODULE", "SZA_CASH_ET");
 
       if (pageContext.isLoggingEnabled(2)) {
         pageContext.writeDiagnostics("NavigationUtility.forwardToPage", "ExpenseTypeTreePG", 2);
       }
 
       NavigationUtility.forwardToPage(pageContext, "CashAndOtherLinesPG", hashmap);
     }
 
     LogMessage = "SZA ExpenseTypeTreeCO.processRequestPageButtons - End";
 
     SzaOIEUtil.cmlinLog(pageContext, LogFunction, LogMessage);
   }
 }



